package com.ashley.apptools.vo;

import java.io.Serializable;

import com.ashley.apptools.provider.ToolsData.ItemNumber;

import android.database.Cursor;


public class ItemVo implements IValue,Serializable{
	/**
	 * 
	 */
	private static final long serialVersionUID = -8269109470792321956L;
	private int category;
	private int id;
	private String itemNo;
	private double price;
	private double cube;
	private double freight;
	private double tax;
	private double landing;
	private double Warehouse;
	private double sale;
	private double retail;
	public int getCategory() {
		return category;
	}
	public void setCategory(int category) {
		this.category = category;
	}
	public int getId() {
		return id;
	}
	public void setId(int id) {
		this.id = id;
	}
	public String getItemNo() {
		return itemNo;
	}
	public void setItemNo(String itemNo) {
		this.itemNo = itemNo;
	}
	public double getPrice() {
		return price;
	}
	public void setPrice(double price) {
		this.price = price;
	}
	public double getCube() {
		return cube;
	}
	public void setCube(double cube) {
		this.cube = cube;
	}
	public double getFreight() {
		return freight;
	}
	public void setFreight(double freight) {
		this.freight = freight;
	}
	public double getTax() {
		return tax;
	}
	public void setTax(double tax) {
		this.tax = tax;
	}
	public double getLanding() {
		return landing;
	}
	public void setLanding(double landing) {
		this.landing = landing;
	}
	public double getWarehouse() {
		return Warehouse;
	}
	public void setWarehouse(double warehouse) {
		Warehouse = warehouse;
	}
	public double getSale() {
		return sale;
	}
	public void setSale(double sale) {
		this.sale = sale;
	}
	public double getRetail() {
		return retail;
	}
	public void setRetail(double retail) {
		this.retail = retail;
	}
	
	public static ItemVo getItemVo(Cursor cursor,int position)
	{
		ItemVo itemVo = null;
		if(cursor.moveToPosition(position))
		{
			itemVo = new ItemVo();
			int itemNo  = cursor.getColumnIndex(ItemNumber.COLUME_ITEM_NO);
			int freight = cursor.getColumnIndex(ItemNumber.COLUME_FREIGHT);
			int tax = cursor.getColumnIndex(ItemNumber.COLUME_TAX);
			int ret = cursor.getColumnIndex(ItemNumber.CLUME_RETAIL);
			itemVo.setItemNo(cursor.getString(itemNo));
			itemVo.setFreight(cursor.getDouble(freight));
			itemVo.setTax(cursor.getDouble(tax));
			itemVo.setRetail(cursor.getDouble(ret));
		}
		return itemVo;
		
	}
	
	
}
